<?php
$lc_id = isset($_GET['lc_id'])?(int)$_GET['lc_id']:0;
$where_sql=" where lc_id = '{$lc_id}'";

$sql = "select * from ".lc()."_user ".$where_sql;
$rs = mysql_query($sql);
if($rs){
	$rows = mysql_fetch_assoc($rs);
	}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo top_keys(7)?></title>
<meta name="description" content="<?php echo top_keys(9)?>">
<meta name="keywords" content="<?php echo top_keys(8)?>">
<link href="<?php echo TPL_URL?>style.css" rel="stylesheet" type="text/css">
<script src="<?php echo TPL_URL?>jquery-1.7.1.min.js"></script>
<script type="text/javascript">
function checkname(){
	var lc_title = $('#lc_title').val();
	if(lc_title){
	$.post("index.php?a=user_name_ajax",{lc_user:lc_title,action:"1"}, function(data){
		$('#namen').html(data);
		});
	}
}
//验证码更换
function newgdcode(obj,url) {
	obj.src = url+ '?nowtime=' + new Date().getTime();//后面传递一个随机参数，否则在IE7和火狐下，不刷新图片
}
</script>
</head>
<body>
<div id="body">
  <?php require('head.php')?>
  <div id="middle">
    <div id="left">
      <div id="type">
        <div class="title">
          <h1>栏目分类</h1>
        </div>
        <ul>
          <li><a href="index.php?p=user">会员信息</a></li>
          <li><a href="index.php?p=shoppingcart_list">购物车</a></li>
          <li><a href="index.php?p=dingdan_list">订单管理</a></li>
          <li><a href="index.php?p=user_zt">高级会员</a></li>
          <li><a href="index.php?a=user_exit">退出会员</a></li>
        </ul>
      </div>
      <!-- type --></div>
    <!-- left -->
    <div id="right">
      <div class="title">
        <h1>会员信息</h1>
        <h3><a href="index.php">首页</a> > 会员中心</h3>
      </div>
      <div id="con">
        <?php
	  	if($_SESSION['user_id']){
			$sql='select * from '.lc().'_user where lc_id='.$_SESSION['user_id'];
			$rs=mysql_query($sql);
			if($rs){
				$rows = mysql_fetch_assoc($rs);
				}
	   ?>
        <form action="index.php?a=user_edit" method="post">
          <ul id="user_dl">
            <li>用户名：{%$usershow.lc_title%}</li>
            <li>姓名：
              <input type="text" name="lc_name" value="<?php echo $rows['lc_name']?>" />
            </li>
            <li>密码：
              <input type="password" name="lc_password" id="lc_password" />
              不填写，为原密码</li>
            <li>确认密码：
              <input type="password" name="lc_password2" id="lc_password2" onBlur="check_psw()" />
              <span id="edit_psw2"></span></li>
            <li>电话：
              <input type="text" name="lc_tel" value="<?php echo $rows['lc_tel']?>" />
            </li>
            <li>邮箱：
              <input type="text" name="lc_email" value="<?php echo $rows['lc_email']?>" />
            </li>
            <li>会员类型：<?php echo user_zt($rows['lc_zt'])?></li>
            <li>
              <input type="submit" value="修改" />
            </li>
          </ul>
        </form>
        <?php
		}
		 else {?>
        <form action="index.php?a=user_login" method="post" onSubmit="return check_login()">
          <ul id="user_dl">
            <li>账&nbsp;&nbsp;号：
              <input name="lc_user" type="text" required id="lc_user" onBlur="checkname()">
              <span id="namen"></span></li>
            <li>密&nbsp;&nbsp;码：
              <input name="lc_password" type="password" required id="password">
              <span id="pass"></span></li>
            <li>验证码：
              <input name="yzm" type="text" required id="yzm" style="width:100px;">
              <img src="index.php?a=imagecode" alt="看不清楚，换一张" title="看不清楚，换一张" align="absmiddle" style="cursor:pointer" onClick="newgdcode(this,this.src)"> <span id="Ryzm"></span> </li>
            <li>
              <input type="submit" style="width:45px; height:25px; border:none; cursor:pointer" value="登陆">
              <a href="index.php?p=user_reg">注册</a></li>
          </ul>
        <?php } ?>
      </div>
    </div>
    <!-- right -->
    <div class="clear"></div>
  </div>
  <?php require('bot.php') ?>
</div>
<!-- body --> 
<br>
<br>
</body>
</html>
